#-*- coding:utf-8 -*-

__author__ = 'wjpingok'

class TimeCalcul:
    @staticmethod
    def TimeBranchSecond(TimeSeconds):
        Minute, Second = divmod(TimeSeconds, 60)
        Hour, Minute = divmod(Minute, 60)
        Days, Hour = divmod(Hour, 24)
        TimeResult = TimeCalcul.TimeInState(Days, Hour, Minute, Second)
        return TimeResult

    @staticmethod
    def TimeInState(Days, Hour, Minute, Second):
        if Days:
            TimeResult = "%d天%d时%d分%d秒" % (Days, Hour, Minute, Second)
            return TimeResult
        elif Hour:
            TimeResult = "%d时%d分%d秒" % (Hour, Minute, Second)
            return TimeResult
        elif Minute:
            TimeResult = "%d分%d秒" % (Minute, Second)
            return TimeResult
        elif Second:
            TimeResult = "%d秒" % (Second)
            return TimeResult

if __name__ == '__main__':
    t = TimeCalcul.TimeBranchSecond(60252500) # 传入参数 "秒" ,time.time() 获取秒
    print t